package com.link2room.optimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 集团价格计划酒店价格计划对照
 * Created by sss on 2016/8/25.
 */
@Entity
@Table(name = "l2r_rateplan_hotel", catalog = "")
@DynamicInsert
public class L2RRateplanHotel extends BaseEntity{
    public enum L2RRateplanHotel_{
        rpCode,hotelRpCode
    }
    /**
     * 价格计划代码
     */
    private String rpCode;
    /**
     * 酒店价格计划代码
     */
    private String hotelRpCode;

    @Basic
    @Column(name = "rp_code", nullable = false, length = 32)
    public String getRpCode() {
        return rpCode;
    }

    public void setRpCode(String rpCode) {
        this.rpCode = rpCode;
    }

    @Basic
    @Column(name = "hotel_rp_code", nullable = false, length = 64)
    public String getHotelRpCode() {
        return hotelRpCode;
    }

    public void setHotelRpCode(String hotelRpCode) {
        this.hotelRpCode = hotelRpCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        L2RRateplanHotel that = (L2RRateplanHotel) o;

        if (rpCode != null ? !rpCode.equals(that.rpCode) : that.rpCode != null) return false;
        if (hotelRpCode != null ? !hotelRpCode.equals(that.hotelRpCode) : that.hotelRpCode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = rpCode != null ? rpCode.hashCode() : 0;
        result = 31 * result + (hotelRpCode != null ? hotelRpCode.hashCode() : 0);
        return result;
    }
}
